package model;


import java.util.Objects;
import java.util.Random;

public class Car {
    private static final String[][] forwards = {
            //行:0:N,1:E,2:S,3:W
            //列:0:straight,1:left,2:right,3:没有用到
            {"N2S","N2E","N2W","N2N"},
            {"E2W","E2S","E2N","E2E"},
            {"S2N","S2W","S2E","S2S"},
            {"W2E","W2N","W2S","W2W"}
    };
    private static final Random r= new Random();

    private String forward;

    public Car(int roadNum,int forwardNum){
        this.forward = forwards[roadNum][forwardNum];
    }

    public String getForward() {
        return forward;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Car car = (Car) o;
        return Objects.equals(forward, car.forward);
    }

}
